let urlPrefix = ''
if (typeof window !== 'undefined') {
  urlPrefix = window.location.origin
}

const uploadOssUrl = '/oss/upload'

let config = {
  USE_OSS_UPLOAD: true,
  /* Zip上传设置 */
  // 上传大小限制(MB)
  ZIP_SIZE_LIMIT: 500,
  /* 图片上传设置 */
  // 上传图片大小限制(MB)
  IMG_SIZE_LIMIT: 2000000000000,
  // 保存路径
  UPLOAD_SAVE_KEY_ZIP: 'octopus/zip/{year}_{mon}_{day}/{hour}_{min}_{sec}_{random32}.{suffix}',
  UPLOAD_SAVE_KEY_ERRORLOG: 'octopus/errorLog/{year}_{mon}_{day}/{hour}_{min}_{sec}_{random32}.{suffix}',
  UPLOAD_SAVE_KEY: 'octopus/images/{year}_{mon}_{day}/{hour}_{min}_{sec}_{random32}.{suffix}', // 图片保存路径
  UPLOAD_SAVE_KEY_EXCEL: 'octopus/excel/{year}_{mon}_{day}/{hour}_{min}_{sec}_{random32}.{suffix}',
  /* Excel上传设置 */
  // 上传大小限制(MB)
  EXCEL_SIZE_LIMIT: 5,
  UPLOAD_BUCKET: 'aek-prod-image',
  UPLOAD_BUCKET_EXCEL: 'aek-prod-doc',
  UPLOAD_BUCKET_ZIP: 'aek-prod-finance',
  UPLOAD_KEY: '',
  UPLOAD_KEY_EXCEL: '',
  UPLOAD_KEY_ZIP: '',
  IMG_UPLOAD: uploadOssUrl,
  EXCEL_UPLOAD: uploadOssUrl,
  ZIP_UPLOAD: uploadOssUrl,
  EXCEL_DOWNLOAD: urlPrefix,
  ZIP_DOWNLOAD: urlPrefix,
  IMG_ORIGINAL: urlPrefix,
  urlPrefix,
  UPLOAD_SECRET: '',
  // 缩略图服务名
  IMG_COMPRESS: '',
  // 水印图服务名
  IMG_WATERMARK: '#IMG_WATERMARK',
}

// 方便node工具调用上传
export default config
